#pragma once

#include <OpenNI.h>
#include "Sensor.h"
#include "Frame.h"

using namespace TipTepCore;

namespace TipTepOpenNI {

public ref class SensorConnector
{
private :	
	nite::HandTracker* m_pHandTracker;
	nite::HandTrackerFrameRef* handFramePtr;
	openni::VideoFrameRef* pDepthFramePtr;
	openni::VideoStream* depthPtr;
	openni::VideoStream* colorPtr;
	openni::Device* DevicePtr;
	bool stopProcessing;	
	System::Object^ locker;		
public:
	SensorConnector(void);
	Sensor^ Start();
	void Stop();
	bool SensorIsStoped();
	delegate void ImageHandler(System::Object^ sender, Frame^ rgb, Frame^ depth, array<TipTepCore::Point3D^>^ handPoints);	
	event ImageHandler^ UpdateImage;	
};

}